﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FullThrustLogic.ShipComponent;

namespace FullThrustLogic.Core
{
    public class Player
    {
        public Player(TypeOfPlayer playerType)
        {
            PlayerType = playerType;
            Ships = new List<Ship>();
        }

        public TypeOfPlayer PlayerType
        {
            get; set;
        }

        public System.Collections.Generic.List<Ship> Ships
        {
            get; set;
        }

        public List<Ship> AvailableToAttackShips
        {
            get
            {
                List<Ship> availableToAttackShips = new List<Ship>();

                foreach(Ship ship in Ships)
                {
                    if(ship.Enabled && ship.AvailableToFire && ship.HasEnemyShipsInRange)
                    {
                        availableToAttackShips.Add(ship);
                    }
                }

                return availableToAttackShips;
            }
        }

        public bool MovementOrdersCommited { get; set; }
    }
}
